<template>
	<view>
		<mine-top :username="userinfo.username" :photo="userinfo.photo" ></mine-top>
		<order-enter :items="orders"></order-enter>

		<!--广告图片-->
		<!--<view class="padding-lr"><image style="width: 100%;height: 80px;border-radius: 4px;object-fit: cover;" mode="aspectFill" src="../../static/tmp/first.jpg"></image></view>
-->
		<list-item :items="items"></list-item>
	</view>
</template>

<script>
import orderEnter from '@/components/devm/mine/order-enter.vue';
import mineTop from '@/components/devm/mine/mine-top.vue';
import listItem from '@/components/devm/mine/list-item.vue';
export default {
	components: {
		orderEnter,
		mineTop,
		listItem
	},
	data() {
		return {
			orders: [
				{
					name: '全部订单',
					iconClass: 'cuIcon-presentfill',
					page: '/pages/order/list?cur=0'
				},
				{
					name: '待付款',
					iconClass: 'cuIcon-moneybagfill',
					page: '/pages/order/list?cur=1'
				},
				{
					name: '待收货',
					iconClass: 'cuIcon-goodsfill',
					page: '/pages/order/list?cur=2'
				},
				{
					name: '待评价',
					iconClass: 'cuIcon-commentfill',
					page: '/pages/order/list?cur=3'
				}
			],
			items: [
				{
					name: '我的优惠券',
					iconClass: 'cuIcon-moneybag',
					page: '/pages/mine/coupon?onlyReceive=true'
				},
				{
					name: '在线客服',
					iconClass: 'cuIcon-service',
					page: 'kefu'
				},
				{
					name: '关于',
					iconClass: 'cuIcon-text',
					page: '/pages/mine/about'
				},
				{
					name: '意见反馈',
					iconClass: 'cuIcon-bad',
					page: 'feedback'
				}
			],
			userinfo:{}
		};
	},onLoad() {
		this.$get('tencent/microapp/getuserinfo',{}).then((res)=>{
			uni.setStorage({
				key:'userinfo',
				data:res.data
			})
		});
	},onShow() {
		var that = this;
		uni.getStorage({
			key:'userinfo',
			success(res) {
				that.userinfo = res.data;
				console.log(that.userinfo)
			}
		})
	}
};
</script>

<style>
page {
	background-color: #f5f5f5;
}
</style>
